package config

type JWT struct {
	SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
}

type System struct {
	Env           string `mapstructure:"env" json:"env" yaml:"env"`
	Mode          string `mapstructure:"mode" json:"mode" yaml:"mode"`
	Addr          int    `mapstructure:"addr" json:"addr" yaml:"addr"`
	DbType        string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
	OssType       string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"`
	UseMultipoint bool   `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
}

type Zap struct {
	Level         string `mapstructure:"level" json:"level" yaml:"level"`
	Format        string `mapstructure:"format" json:"format" yaml:"format"`
	Prefix        string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	Director      string `mapstructure:"director" json:"director"  yaml:"director"`
	LinkName      string `mapstructure:"link-name" json:"linkName" yaml:"link-name"`
	ShowLine      bool   `mapstructure:"show-line" json:"showLine" yaml:"showLine"`
	EncodeLevel   string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"`
	StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"`
	LogInConsole  bool   `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"`
	FileFormat    string `mapstructure:"file-format" json:"fileFormat" yaml:"file-format"`
}

type Upload struct {
	Url            string   `mapstructure:"url" json:"url" yaml:"url"`
	BinPath        string   `mapstructure:"bin-path" json:"bin-path" yaml:"bin-path"`
	BinMaxsize     int      `mapstructure:"bin-maxsize" json:"bin-maxsize" yaml:"bin-maxsize"`
	BinAllowExts   []string `mapstructure:"bin-allow-exts" json:"bin-allow-exts" yaml:"bin-allow-exts"`
	ImagePath      string   `mapstructure:"image-path" json:"image-path" yaml:"image-path"`
	ImageMaxsize   int      `mapstructure:"image-maxsize" json:"image-maxsize" yaml:"image-maxsize"`
	ImageAllowExts []string `mapstructure:"image-allow-exts" json:"image-allow-exts" yaml:"image-allow-exts"`
}

type Mysql struct {
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
}

type Emqx struct {
	ApiUrl       string   `mapstructure:"api-url" json:"api-url" yaml:"api-url"`
	Host         string   `mapstructure:"host" json:"host" yaml:"host"`
	Username     string   `mapstructure:"username" json:"username" yaml:"username"`
	Password     string   `mapstructure:"password" json:"password" yaml:"password"`
	KeepAlive    int      `mapstructure:"keep-alive" json:"keep-alive" yaml:"keep-alive"`
	AutoTopics   []string `mapstructure:"auto-topics" json:"auto-topics" yaml:"auto-topics"`
	LockTopics   []string `mapstructure:"lock-topics" json:"lock-topics" yaml:"lock-topics"`
	OnlineTopics []string `mapstructure:"online-topics" json:"online-topics" yaml:"online-topics"`
	LogTopics    []string `mapstructure:"log-topics" json:"log-topics" yaml:"log-topics"`
}

type Server struct {
	JWT    JWT    `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	Zap    Zap    `mapstructure:"zap" json:"zap" yaml:"zap"`
	Upload Upload `mapstructure:"upload" json:"upload" yaml:"upload"`
	// Redis   Redis   `mapstructure:"redis" json:"redis" yaml:"redis"`
	// Email   Email   `mapstructure:"email" json:"email" yaml:"email"`
	// Casbin  Casbin  `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
	System System `mapstructure:"system" json:"system" yaml:"system"`
	// Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
	// // gorm
	Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Emqx  Emqx  `mapstructure:"emqx" json:"emqx" yaml:"emqx"`
	// // oss
	// Local Local `mapstructure:"local" json:"local" yaml:"local"`
	// Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
}
